home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1989 January
/
Ahoy_Magazine_89-01_1989_Double_L.d64
/
Quickly Random
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
489b
|
16 lines
0 print"[147] quickly random":poke53280,1:poke53281,1
1 rem =================================
2 rem commodares problem #57-1 :
3 rem quickly random
4 rem solution by
5 rem bob rispoli
6 rem =================================
10 dimx(100):forj=1to100:x(j)=j:next
15 ti$="000000"
20 forj=1to100:n=int(rnd(1)*100)+1:a=x(n):x(n)=x(j):x(j)=a:next
25 print ti"jiffies"
30 printtab(16)" done [146]"
40 print:print"to see the rearranged array hit any key"
50 geta$:ifa$=""goto50
60 forj=1to100:printtab(15)"x"j"="x(j):ford=1to200:next:next